<?php
/*
* Author: Nguyen Hai Nam
* Module: Product
* Desc	: Introduce pick.vn and sidle pic
* Date	: 12/12/2011
*/
class ProductSubModule extends Pick_Core_Module{
	function ProductModule(){
		parent::Pick_Core_Module();
		# Languages
		$languages = new Pick_Core_Languages();
		$objectLanguages = "";
		$objectLanguages = $languages->getObjects(1, 'status = 1', array('position'=>'ASC'), '');
		if($objectLanguages){
			$objectLanguages = $objectLanguages['data'];
		}#endif
		$this->template->assign("objectLanguages", $objectLanguages);
	}
	public function getContent(){

		$productcategory = new Pick_Dao_ProductCategory();
		$product = new Pick_Dao_Product();
		$id = $this->request->get('id');
		$objCategory = $productcategory->getObject($id);
        $backgroundimage = $objCategory->getFullUrlBackGround();
        $this->template->assign('backgroundimage', $backgroundimage);
		$arrSubCategory = $productcategory->getSubCategory($id);
		$this->template->assign('product', $product);
		$this->template->assign('productcategory', $productcategory);
		$this->template->assign('objCategory', $objCategory);
		var_dump('<pre>', $arrSubCategory);die;
		$this->template->assign('arrSubCategory', $arrSubCategory);
        if(!empty($objCategory)){
            $this->template->assign('warranty', $objCategory->getField('file1'));
            $this->template->assign('video', $objCategory->getField('file2'));
            $this->template->assign('quickguide', $objCategory->getField('file3'));
        }
	}
}